home *** CD-ROM | disk | FTP | other *** search
- Path: cbisinet.cbis.com!ptutko
- From: ptutko@cbis.com (Peter Tutko)
- Newsgroups: comp.lang.c++
- Subject: Re: Computer hangs at the end of this when run. (iostreams and fstreams)
- Date: 18 Apr 1996 20:02:46 GMT
- Organization: Cincinnati Bell Information Systems
- Message-ID: <4l6756$91o@cbisinet.cbis.com>
- References: <4l1oce$18s@majesty.lightlink.com>
- NNTP-Posting-Host: mongoose.isd.cbis.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Justin Kramer AKA Tinman (jkramer@lightlink.com) wrote:
- : Hi,
-
- : I JUST started to program in C++ with iostreams ...
-
- [code example snipped]
-
- Your problem is that you have not allocated space for the character strings,
- just a pointer to it. Go ahead and declare a while array for the string:
-
- char line[80];
-
- Then try to output it via the stream. I think you'll find it works a bit better.
-
-
- --
- Peter M. Tutko "Nobody gets in to see the Wizard.
- ptutko@access.digex.net Not no body. No nohow." - F.Baum
- "You are a strange, sad little man
- and you have my pity." - B.Lightyear
-